begintownscript;
variables;
    int choice;
    int fx = 0, fy = 0;
body;
beginstate INIT_STATE;
    set_name(11, "Schazam");
    set_name(10, "James");
    set_name(15, "Jerry");
    set_name(6, "Graham");
    if ((get_current_tick() < 625) || (get_current_tick() > 4375) &&
         (get_current_tick() < 5000 + 625) || (get_current_tick() > 5000 + 4375) &&
         (get_current_tick() < 10000 + 625) || (get_current_tick() > 10000 + 4375) &&
         (get_current_tick() < 15000 + 625) || (get_current_tick() > 15000 + 4375) &&
         (get_current_tick() < 20000 + 625) || (get_current_tick() > 20000 + 4375) &&
         (get_current_tick() < 25000 + 625) || (get_current_tick() > 25000 + 4375))
         set_state_continue(50);
break;
beginstate EXIT_STATE;

break;
beginstate START_STATE;
    if ((get_current_tick() < 625) || (get_current_tick() > 4375) &&
         (get_current_tick() < 5000 + 625) || (get_current_tick() > 5000 + 4375) &&
         (get_current_tick() < 10000 + 625) || (get_current_tick() > 10000 + 4375) &&
         (get_current_tick() < 15000 + 625) || (get_current_tick() > 15000 + 4375) &&
         (get_current_tick() < 20000 + 625) || (get_current_tick() > 20000 + 4375) &&
         (get_current_tick() < 25000 + 625) || (get_current_tick() > 25000 + 4375))
         set_state_continue(50);
break;
beginstate 10;
    if (get_flag(19, 0) == 0)
        message_dialog("The western part of the city is a great example of the peace made with the kingdom of Avernum and the Empire.", "Many of the buildings here are built in Avernite style. It is a unique style that can't be compared with other architectures.");
    set_flag(19, 0, 1);
break;
beginstate 11;
    if (get_flag(19, 1) == 0)
        message_dialog("This place is not only built by Avernites, it is also inhabitated by them. There are pale people, nephilim and even slithzerikai here.", "They are all living in harmony. This is a good example on how the world should look like.");
    set_flag(19, 1, 1);
break;
beginstate 12;
    if (get_flag(19, 2) == 0)
        message_dialog("The market is currently out of order.", "");
    set_flag(19, 2, 1);
break;
beginstate 13;
    block_entry(1);
    if (in_boat() == -1) move_to_new_town(3, 5, 33);
    else move_to_new_town(3, 5, 30);
break;
beginstate 14;
    if (get_flag(119, 12) >= 1)
    {
        reset_dialog();
        add_dialog_str(0, "You wait a while. Jerry arrives. _Shall we go then?_ he asks.", 0);
        add_dialog_choice(0, "No");
        add_dialog_choice(1, "Yes");
        if (run_dialog(0) == 2)
            move_to_new_town(11, 20, 25);
    }
break;
beginstate 50;
       while (fy < 48)
         {
         if (get_terrain(fx, fy) == 480)
             set_terrain(fx, fy, 209);
         fx = fx + 1;
         if (fx == 48)
             {
             fx = 0;
             fy = fy + 1;
             }
         }
break;